<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        .box {
            width: 100px;
            height: 100px;
            background-color: #000;
        }
    </style>
</head>

<body>
    <button onclick="click1()">变宽</button>
    <button onclick="click2()">变高</button>
    <button onclick="click3()">变色</button>
    <button onclick="click4()">影藏</button>
    <button onclick="click5()">重置</button>
    <div class="box">

    </div>
</body>
<script>
let div = document.querySelector('.box')
function click1() {
    div.style.width="400px"
}
function click2() {
    div.style.height="400px"
}
function click3() {
    div.style.backgroundColor="red"
}
function click4() {
    div.style.display="none"
}
function click5() {
    div.style=""
}
</script>

</html>